<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/common.inc"%>
<c:if test="${FLAG=='ADD' }">
 <c:set var="action" value="${ctx}/banner/add"/>
</c:if>
<c:if test="${FLAG=='UPDATE'}">
 <c:set var="action" value="${ctx}/banner/update/${bannerInfo.id}"/>
</c:if>
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>
        ${FLAG=='ADD'?'新增':'编辑' }大图-俍欣高原反应信息管理系统
    </title>
    <%@ include file="../common/taglib.jsp" %>
      <link rel="stylesheet" href="${ctx }/resources/css/common/uniform.css"/>
      <link rel="stylesheet" href="${ctx }/resources/css/common/matrix-style2.css"/>
      <link rel="stylesheet" href="${ctx }/resources/css/common/fancybox.css" media="screen"/>
      <link rel="stylesheet" href="${ctx }/resources/css/style_common.css?v=20160423"/>
  </head>
  <body>
    <div id="content">
      <div id="content-header">
        <h1>${FLAG=='ADD'?'新增':'编辑' }大图</h1>
      </div>
      <div class="container-fluid">
        <div class="row-fluid">
          <div class="span12">
            <div class="widget-box">
	          <div class="widget-title"> <span class="icon"> <i class="icon-pencil"></i></span>
	            <h5></h5>
	          </div>
	          <div class="widget-content nopadding">
	            <form:form id="banner-form" class="form-horizontal" method="post" commandName="bannerInfo" action="${action }">
	              <form:hidden path="id"/>
	              <div id="form-wizard-1" class="step">
	                <div class="control-group">
	                  <label class="control-label">图片</label>
	                  <div class="controls">
	                    <div class="form-img">
	                      <c:if test="${not empty bannerInfo.image }">
	                        <a class="fancybox" href="${bannerInfo.image}" title="查看大图"><img class="image-w200" alt="" src="${bannerInfo.image }"></a>
	                      </c:if>
	                    </div>
			            <div class="form-img-load">
			            	<img src="${ctx}/resources/images/loading.gif">
			            </div>
			            <div class="form-img-up">
			              <input type="file" id="f1" name="uploadFile">
			        	  <img src="${ctx}/resources/images/up8.jpg" id="imgUpload">
			        	  <input type="hidden" readonly="readonly" required="required" name="image" id="image" value="${bannerInfo.image }">
			        	</div>
	                  </div>
	                </div>
	                <div class="control-group">
	                  <label class="control-label">链接</label>
	                  <div class="controls">
	                    <input type="text" name="link" id="link"  required="required" value="${bannerInfo.link}"/>
	                  </div>
	                </div>
	                <div class="control-group">
	                  <label class="control-label">状态</label>
	                  <div class="controls">
	                    <label>
		                  <input type="radio" name="status" <c:if test="${FLAG=='ADD' || bannerInfo.status==1}">checked="checked"</c:if> value="1"/>
		                                             启用
		                </label>
		                <label>
		                  <input type="radio" name="status" value="0" <c:if test="${bannerInfo.status==0}">checked="checked"</c:if>/>
		                                             停用
		                </label>
	                  </div>
	                </div>
	              </div>
	              <div class="form-actions">
	                <input id="submit-form" class="btn btn-primary" type="submit" value="保存" />
	                <input id="reset-form" class="btn btn-danger" type="reset" value="重置" />
	                <div id="status"></div>
	              </div>
	              <div id="submitted"></div>
	            </form:form>
	          </div>
	        </div>
          </div>
        </div>
      </div>
    </div>
    <%@ include file="../common/taglib_js.jsp" %>
    <script src="${ctx }/resources/js/plugin/ajaxfileupload.js"></script>
    <script src="${ctx }/resources/js/banner.js?v=20160423"></script>
    <script src="${ctx }/resources/js/form.validation.js?v=20160423"></script>
  </body>
</html>